//$Rev: 36425 $
//<![CDATA[
if(!window.mmcore){
	window.mmcore={
	domain:'k12.com',
	server:'service.maxymiser.net/cg/v5us/',
	cookie_domain:'.k12.com',
	tpixel:false,
	cprefix:'mmcore.',
	inline_state:true,
	OPC_install:function(){var t=this;t.SetParam('OPC.install','1');t._async=1;t.tpixel=false;t.CGRequest()},
	SetCookie:function(n,v,d,g){var _t=this,_h=_t._Host(_t._TL(location.hostname)),exp=_t._FutureDate(d);
		_t._d.cookie=escape(eval(g)?n:_t._PN(n))+'='+escape(v)+(_h.length?';domain='+_h:'')
		+';path=/'+(typeof d!='undefined'&&d!=0?(';expires='+exp.toGMTString()):'');_t.SetParam(n,v)},
	GetCookie:function(n,g){var _t=this;return unescape(_t._ValByKey(_t._d.cookie,escape(g?n:_t._PN(n)),'=',';'))},
	HideMaxyboxes:function(names){this._MbStyle('{visibility:hidden;}',this._Args2Arr(arguments))},
	ShowMaxyboxes:function(names){var i,obj,nn=this._Args2Arr(arguments);for(i=0;i<nn.length;i++){obj=this.GetMaxyboxNode(nn[i]);if(obj)obj.style.visibility='visible'}},
	GetMaxyboxNode:function(m){return document.getElementById(m)},
	IsDefaultArrived:function(m){var _t=this,b,x=_t.GetMaxyboxNode(m);if(!x)return false;b=document.body,p='parentNode';while(!x.nextSibling&&x!=b&&x[p])x=x[p];if(x==b||!x[p])return false;return true},
	SetAction:function(name,val,attr){var _t=this;_t._vars.act['a'+(_t._act_id++)+'_'+_t._T(name)]=''+_t._ToNum(0,val)+','+(encodeURIComponent(attr||''))},
	$Action:function(){var _t=this,a=_t.GetCookie("mmact",1)+_t._S(arguments);_t.SetCookie("mmact",a,1,1)},
	SetPersCriterion:function(name,val){this._vars.uat[this._T(name)]=(encodeURIComponent(val||''))},
	SetParam:function(name,val){var t=this;t._vars[t._TL(name)]=(val||'');if(t[name]&&val)t[name]=val},
	GetParam:function(name){var t=this;return t._vars[t._TL(name)]||t[name]},
	SetPageID:function(id){this.SetParam('PageID',encodeURIComponent(id))},
	SetVisitorID:function(id,idtype){var t=this,_i=idtype;if(!_i)_i=1;t._vars.ids[_i]=encodeURIComponent(id)},
    SetPAFilter:function(category_id,category_name,is_inclusion){this._filters.push({category_id:category_id,category_name:category_name,is_inclusion:is_inclusion?1:0});},
    SetProductFilter:function(category_id,product_id,is_inclusion){this._filters.push({category_id:category_id,product_id:product_id,is_inclusion:is_inclusion?1:0,is_product:1});},
	CGRequest:function(callback){var _t=this,o=_t._DS(_t.GetCookie("mmact",1),function(){_t.SetAction.apply(_t,this)});_t.SetCookie("mmact","",-1,1);_t._callback[++_t._request_id]=callback;return _t.GetParam("gm")!=2?(_t._sid=_t._Tag(_t._TagUri())):null},
	RenderMaxyboxes:function(names){var t=this,i=0,_tr=t._renderers,nn,a=t._Args2Arr(arguments);if(a.length<=0)for(nn in _tr)a.push(nn);
		for(;i<a.length;i++){nn=a[i];if(_tr[nn]&&!t._r_mbs[nn])try{_tr[nn]()}catch(e){};t._r_mbs[nn]=1;t.ShowMaxyboxes(nn)}},
	AddDocLoadHandler:function(handler){var t=this,d=t._d,f,tm1,u=t._L(navigator.userAgent);
		if(t._docEnd&&handler)return handler();else t._docEndF.push(handler);if(t._docEndF.length>1)return;
		mmcore.evnt=function(){var i=0;if(!t._docEnd){t._docEnd=true;for(;i<t._docEndF.length;i++)try{t._docEndF[i]()}catch(e){};}t._docEndF=[]};
		if(/webkit/.test(u))f=function(){return d.readyState=="loaded"||d.readyState=="complete"};
		else if(/msie/.test(u)&&window==top)f=function(){try{d.documentElement.doScroll("left");return true}catch(e){return false}};
		if(f)tm1=setInterval(function(){if(f())mmcore.evnt();if(t._docEnd&&tm1){clearInterval(tm1);tm1=null;f=null}},500);
		if((/mozilla/.test(u)&&!/(compatible)/.test(u))||(/opera/.test(u))){t._d.addEventListener("DOMContentLoaded",mmcore.evnt,false);return;}
		window._mm_owl1=t._w.onload;t._w.onload=function(event){mmcore.evnt();if(window._mm_owl1)return window._mm_owl1(event);}},
//transport
	Request:function(callback){var _t=mmcore;_t._rd=(new Date()).getTime();_t._async=true;return (_t._sid[_t._request_id-1]=_t.CGRequest(callback||function(){}))},
	IsFinished:function(){var _t=mmcore,r=true,i,tc=_t._callback;if(_t.tpixel)r=((new Date()).getTime()-_t._rd)>=_t._rt;for(i=0;i<tc.length;i++)r=r&&(tc[i]==null);return r},
	StopRequest:function(){var _d=document,_t=mmcore,_n,i,s=_t._sid;for(i in s){_n=_d.getElementById(s[i]);if(_n){(_n.parentNode||_d).removeChild(_n);_n.src='about:blank';delete _n}}},
	_rt:1000,
//private
	jsver:'5.14',_vars:{fv:{},act:{},uat:{},ids:{}},_act_id:0,_vars_alias:{act:'uv'},_renderers:{},_extensions:{},_r_mbs:{},
	_async:false,_w:window,_d:document,_undef:undefined,_callback:[],_request_id:0,
	_filters:[],
	_sid:[],_rd:null,_docEnd:false,_docEndF:[],_incrRender:true,
	_FutureDate:function(days){var d=new Date();d.setTime(d.getTime()+days*86400000);return d},
	_AddRenderer:function(mb,func){this._renderers[mb]=func},
	_ValByKey:function(str,key,f,r){
		var k=key.replace(/\./g,'\\.'),sre1='\\s*('+k+')\\s*'+f+'([^'+r+']*)',r2='',m,_t=this,re=new RegExp(r+sre1,'gm'),re1=new RegExp('^'+sre1,'gm');
		while((m=re.exec(str))!=null)r2=_t._T(m[2]);if(r2===''&&(m=re1.exec(str))!=null)r2=_t._T(m[2]);
		return r2;},
	_ReadParams:function(str,f,r){
		var _t=this,p=_t.cprefix,rs=[str],rs1,i,i1,kv;if(p.length==0)return;r=[].concat(r);
		for(i=0;i<r.length;i++){rs1=[];for(i1=0;i1<rs.length;i1++)rs1=rs1.concat(rs[i1].split(r[i]));rs=rs1}
		for(i=0;i<rs.length;i++){kv=rs[i].split(f);if(kv.length!=2)continue;
			kv[0]=_t._TL(kv[0]);if(kv[0].indexOf(p)==0)_t.SetParam(kv[0].substr(p.length),_t._T(kv[1]))}},
	_Args2Arr:function(){var r=[],i=0,a=arguments[0],l=a.length;
		if(l>0){if(a[0] instanceof Array)r=a[0];else if(!(a[0]instanceof Object))for(;i<l;i++)r[i]=a[i]}return r},
	_S:function(a){
		var i = 0, l = a.length;
		for (; i < l; i += 1)a[i] = escape(a[i]);
		return "<" + escape([].join.call(a, ',')) + ">";
	},
	_DS:function(s,f){
		s.replace(/<(.+?)>/g, function () {
			var a = unescape(arguments[1]).split(","), i = 0, l = a.length;
			for (; i < l; i += 1)a[i] = unescape(a[i]);
			f.call(a);
		})
	},
	_ToNum:function(def_val,str){return (typeof str==undefined||isNaN(str))?def_val:Number(str)},
	_T:function(str){return str.replace(/^\s+/g, '').replace(/\s+$/g, '')},
	_L:function(str){return str.toLowerCase()},
	_TL:function(str){return this._L(this._T(str))},
	_PN:function(str){return this._T(this.cprefix+str)},
	_SerializeArray:function(arr){
	    var row,el,res='',col='',rec;
	    for(row=0;row<arr.length;row++){col='';
	        for(el in arr[row]){rec=arr[row][el];if(typeof rec=='undefined') rec='';col+=encodeURIComponent(rec)+',';}
	        if (col.length>0) col=col.slice(0,-1);res+=col+';';}
	    return encodeURIComponent(res);},
	_Host:function(h){
		function n(t){return '.' + t.replace(/^www\./i, '')}
		function m(t){return (new RegExp(t.replace(/\./g, '\\.') + '$'))}
		function c(s1,s2){return s1.match(m(s2))}var _t=this,_h=n(h),_d=n(_t.domain),_cd=_t.cookie_domain;return (c(_cd,_h)||c(_h,'.'+_cd.replace(/^\./,'')))?_cd:(c(_h,_d)?_d:_h)},
	_TagUri:function(){
		this._InitRef();var _t=this,_a,_vv=_t._vars,_p=location.protocol,s='',s1,i,_v,_k;
		_t.SetParam('jsver',_t.jsver);_t.SetParam('tp',_t.tpixel?'1':'');
		for(i in _vv){_v=_vv[i];s1='';
			if(typeof _v=='object'){_a=(_v==_vv.act);for(_k in _v)s1+=(_a?_k.replace(/^a\d+?_/,''):_k)+'='+_v[_k]+';';s1.slice(0,-1)}else s1=_v;
			if(s1.length)s+=(_t._vars_alias[i]||i)+'='+encodeURIComponent(s1)+'&'
		};
		s =_t.server+'?'+s.slice(0,-1)+'&ri='+_t._request_id+'&rul='+_t._SerializeArray(_t._filters);
		return s.indexOf('://')>0?s:_p+'//'+s},
	_Tag:function(uri){
		var _t=this,_n,px=_t.tpixel,tp='text/javascript',d=_t._d,_a,id=_t.cprefix+_t._request_id;if(_t.GetParam('gm')=='2')return;
		if(_t._async){
			_n=d.createElement(px?'img':'script');_n.id=id;_n.src=uri;if(!px){_n.type=tp;_n.charset='utf-8'};
			_a=d.getElementsByTagName(px?'body':'head');if(_a&&_a.length)_a[0].appendChild(_n)
		}else{
			try{_t._d.write(px?'<img id="'+id+'" src="'+uri+'"\/>':'<scr'+'ipt id="'+id+'" type="'+tp+'" charset="utf-8" src="'+uri+'"><\/scr'+'ipt>')}
			catch(e){_t._async=true;_t._Tag(uri)}
		}_t._Clear();return id},
	_RenderOnLoad:function(){var t=this,tm,f1,f2;
		f1=function(){t.RenderMaxyboxes()};t.AddDocLoadHandler(f1);
		f2=function(){var m,ok=true,ma=t._r_mbs;
			for(m in t._renderers){if(t._docEnd||(!ma[m]&&t.IsDefaultArrived(m)))t.RenderMaxyboxes(m);if(!ma[m])ok=false}if(ok)clearInterval(tm)
		};if(t._incrRender){tm=setInterval(f2,100);f2();}},
	_MbStyle:function(vis,arg){var s='<style type="text/css">',i=0;for(;i<arg.length;i++)s+=(i>0?',#':'#')+arg[i];s+=vis+'</style>';this._d.write(s)},
	_InitVcb:function(u,cid){var _t=this,_d=_t._d,_vs; _vs=_d.createElement("script");_vs.type='text/javascript';_vs.src=unescape(u+'?cid='+cid);_vs.charset='utf-8';_d.getElementsByTagName('head')[0].appendChild(_vs);_t.SetParam('gm',2);_t.SetCookie('cfgid',1,0);},
	_DestroyVcb:function(){this.SetCookie('mmVcbInitScriptUrl',null,1,false);},
	_InitRef:function(){var _t=this;_t._d=document;_t._w=window;},
	_Init:function(first){
		var _t=this,_fv=_t._vars.fv,_w=_t._w.screen,_u=location.href,_r=_t._d.referrer,_rnd=(''+Math.random()).substring(0,5),_id,vcb_url,cid='0';
		_t._Clear();if(first){_id=_t._ValByKey(_u,_t._PN('pd'),'=','&');if(_id.length)_t.SetCookie('pd',_id,7);}
		try{_t._ReadParams(_t._d.cookie,'=',';');_t._ReadParams(_u,'=',['&','?','#'])}catch(e){}
		_fv.dmn=_t.domain;if(_r.length>256)_r=_r.substring(0,256);if(_u.length>1024)_u=_u.substring(0,1024);
		_fv.ref=escape(_r);_fv.url=encodeURIComponent(_u);_fv.scrw=_w.width;_fv.scrh=_w.height;_fv.clrd=_w.colorDepth;
		_t.SetCookie('tst',_rnd,10);_fv.cok=(_t.GetCookie('tst')==_rnd?1:0);
		_id=_t.GetCookie('mmid',1);if(_id.length)_t.SetParam('mmid',_id);
		
		if (typeof _r!='undefined'&&_r!=''){
		if(_t._ValByKey(_r.split('?')[1],'pt.enabled','=','&')=='1')		
			{_t.SetCookie('pt.enabled','1',0.5,false);_t.SetCookie('mmauthid',unescape(_t._ValByKey(_r.split('?')[1],'pt.mmauthid','=','&')),4,false);}
		cid=_t._ValByKey(_r.split('?')[1],'mode','=','&');
		if (!vcb_url){
				vcb_url=_t._ValByKey(_r.split('?')[1],'VcbInitScriptUrl','=','&');
				if(vcb_url!=''&&vcb_url!=-1){_t.SetCookie('mmVcbInitScriptUrl',vcb_url,1,false);}}
		}
		vcb_url=_t.GetCookie('mmVcbInitScriptUrl');if(vcb_url.length&&vcb_url!="null")_t._InitVcb(vcb_url,cid);
	},
	_Clear:function(){var v=this._vars;v.mb={};v.act={};v.uat={}}
};

if (location.hostname.indexOf('keystoneschoolonline.com')+1) mmcore.cookie_domain = '.keystoneschoolonline.com';
else if (location.hostname.indexOf('keystonecreditrecovery.com')+1) mmcore.cookie_domain = '.keystonecreditrecovery.com';
else if (location.hostname.indexOf('gwuohs.com')+1) mmcore.cookie_domain = '.gwuohs.com';
else if (location.hostname.indexOf('insightschools.net')+1) mmcore.cookie_domain = '.insightschools.net';
else if (location.hostname.indexOf('internetelementary.com')+1) mmcore.cookie_domain = '.internetelementary.com';
else if (location.hostname.indexOf('internethighschool.com')+1) mmcore.cookie_domain = '.internethighschool.com';

if (navigator.userAgent.toLowerCase().indexOf("opera")!=-1) {mmcore.CGRequest=function (args) {return false;};}
else window.mmcore._Init(true);
if(window.mmPageID) mmcore.SetPageID(window.mmPageID);
mmcore.CGRequest(function(){mmcore.inline_state=false});
if(/Firefox/.test(navigator.userAgent)){mmcore.AddDocLoadHandler(function(){})};
}
//]]>